package com.libgdxbar.pvzlikegame.entities;

import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

// 矩形实体
public class RectEntity extends Entity {
	final Rectangle rect;

	public RectEntity(Vector2 position, Vector2 size) {
		this(position.x, position.y, size);
	}

	public RectEntity(float x, float y, Vector2 size) {
		this(x, y, size.x, size.y);
	}

	public RectEntity(float x, float y, float width, float height) {
		rect = new Rectangle(x, y, width, height);
	}

	@Override
	public void run(float delta) {

	}

	public Rectangle getRect() {
		return rect;
	}

	public void setSize(Vector2 size) {
		setSize(size.x, size.y);
	}

	public void setSize(float x, float y) {
		rect.setSize(x, y);
	}

	public float getWidth() {
		return rect.getWidth();
	}

	public void setWidth(float width) {
		rect.setWidth(width);
	}

	public float getHeight() {
		return rect.getHeight();
	}

	public void setHeight(float height) {
		rect.setHeight(height);
	}
}
